import {createRouter, createWebHashHistory} from 'vue-router'

import basics from './basics'
import lesson from "./lesson";

const modules = [
  basics,
  // lesson
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: {
        name: 'Login'
      }
    },
    {
      path: '/login',
      name: 'Login',
      meta: {
        hidden: true
      },
      component: () => import('../views/login/login.vue')
    },
    ...modules
  ]
})
router.beforeEach((to, from, next) => {
  console.log('router.beforeEach to', from)
  next()
})

export default router